<?

$_table = 'CC_DOC_TEMPLATES';
$_parent_key = 'classificatorvalue_id';

$res = array('num' => 0);
//dbdebug();

if ($id = gccHuuid(param('id'))) {
	$_crit = "$_parent_key=$id";

	if ($d = datafetch_array('db_item', $_table, $_crit, 'count(id) num')) {
		$res['num'] = $d['num'];
	}
}

header("Content-Type: application/json; charset=utf-8");
print json_encode($res);

exit;
